package com.hntech.base.thread;

public class VolatileCase extends Thread {

    private  Boolean flag = false;

    public void run() {
        while (!flag) {

        }
    }

    public static void main(String[] args) throws InterruptedException {
        VolatileCase vCase = new VolatileCase();
        vCase.start();
        Thread.sleep(100);
        vCase.flag = true;
    }

}
